/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef DRAWING_BENCH_DEMO_DRAW_PATH_H
#define DRAWING_BENCH_DEMO_DRAW_PATH_H
#include "drawing_bench_test_base.h"

namespace OHOS {
namespace Rosen {
class DrawPathTest : public TestBase {
public:
    DrawPathTest() : TestBase() {}
    virtual ~DrawPathTest() = default;
protected:
    void OnTestFunctionCpu(Drawing::Canvas* canvas) override
    {
        Drawing::Pen pen;
        pen.SetColor(0xFFFF0000);
        pen.SetWidth(10.0f);
        canvas->AttachPen(pen);
        Drawing::Path path;
        path.MoveTo(0, 0);
        path.LineTo(300, 300);
        canvas->DrawPath(path);
        canvas->DetachPen();       
    }
    void OnTestFunctionGpuUpScreen(Drawing::Canvas* canvas) override
    {
        Drawing::Pen pen;
        pen.SetColor(0xFF00FF00);
        pen.SetWidth(10.0f);
        canvas->AttachPen(pen);
        Drawing::Path path;
        path.MoveTo(0, 0);
        path.LineTo(500, 500);
        canvas->DrawPath(path);
        canvas->DetachPen();       
    }
    void OnTestPerformance(Drawing::Canvas* canvas) override
    {
        Drawing::Pen pen;
        pen.SetColor(0xFFFF0000);
        pen.SetWidth(10.0f);
        canvas->AttachPen(pen);
        Drawing::Path path;
        path.MoveTo(0, 0);
        path.LineTo(300, 300);
        for (int i = 0; i < testCount_; i++) {
            canvas->DrawPath(path);
        }
        canvas->DetachPen();
        }
};
} // namespace Rosen
} // namespace OHOS
#endif // DRAWING_BENCH_DEMO_DRAW_PATH_H